package com.tiancheng.trade.order.enums;

import com.tiancheng.trade.commom.core.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author: likailun
 * @Description:
 * @Date: create in 2023/2/9 17:03
 */
@Getter
@AllArgsConstructor
public enum DiscountTypeEnum implements BaseEnum<String> {

    discount("discount", "折扣"),
    use_beam("use_beam", "云币"),
    pt_coupon("pt_coupon", "平台优惠券"),
    channel_coupon("channel_coupon", "渠道优惠券"),
    deduction_card("deduction_card", "抵扣卡"),
    ;

    private String code;
    private String desc;

    public static String getDesc(String code) {
        DiscountTypeEnum[] businessModeEnums = values();
        for (DiscountTypeEnum statusEnum : businessModeEnums) {
            if (statusEnum.code().equals(code)) {
                return statusEnum.desc();
            }
        }
        return null;
    }

    public String code() {
        return this.code;
    }

    public String desc() {
        return this.desc;
    }
}
